The data was derived from "Our World in Data" website. Its is basically worldwide emissions data. The columns contained include:
#install packages
! pip install --upgrade pandas
! pip install chart-studio
! pip install --upgrade plotly
! pip install -U kaleido
#load packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import kaleido
import plotly.graph_objects as go
import plotly.express as px
from plotly.offline import plot, iplot
from plotly.subplots import make_subplots
import plotly.io as pio
pio.renderers.default = "svg"
%matplotlib inline
#load csv file
world=pd.read_csv("owid-co2-data.txt")
world
#the dimensions
world.shape
world.info()
world.columns
world.dtypes
world.country.unique()
world_cont=world.query("country=='Africa'|country=='Antarctica'|country=='Asia'|country=='South America'|country=='North America'|country=='Oceania'|country=='Europe'|country=='World'")
px.line(world_cont,x="year",y="co2",color="country",labels={'country':'Country','year':'Year','co2':'Carbon(iv)oxide'},width=950,height=900,
title="<b>Carbon(iv)oxide emissions from 1750 to 2020 for Different Continents</b>")
Asia started out as a low-emitting continent until 1950 when its CO2 emissions continued to rise progressively. By 1992, Asia exceeded Europe to become the highest CO2-emitting continent. North America exceeded Europe in 1994 to become the 2nd highest CO2-emitting continent. However, In 2020, Asia still had more than 3.5 times the emissions of North America. Africa and South America share a somewhat similar emissions pathway with Africa exceeding South America in 1981 and 2000. Oceania has maintained its low-emitting position alongside Antarctica. For the world, we see a progressive rise in emissions since the industrial revolution and the last peak in 2019.
world_cont2=world_cont[world_cont['year']>=1800]
px.line(world_cont2,x="year",y="co2_per_capita",color="country",labels={'country':'Country','year':'Year','co2_per_capita':'Carbon(iv)oxide per Capita'},width=950,height=900,
title="<b>Carbon(iv)oxide per Capita emissions from 1800 to 2020 for Different Contintents</b>")
The continents' CO2 emissions per capita tell a different story. North Americans have the highest emitters since 1858 up until 2016 when Oceanians overtook its position. Oceania is a low-emitting continent, however, Oceanians are amongst the highest polluters. Europeans are the 3rd highest polluters followed by Asians. Africans and South Americans are the least contributors.
world_2020=world.query("year==2020")
fig = px.choropleth(world_2020, color="co2",
locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.007,11000],
hover_data=["country", "co2", "co2_per_gdp"],width=1000,
labels={'country':'Country','year':'Year','co2':'Carbon(iv)Oxide in Gigatonnes',
'co2_per_gdp':'Carbon(iv)Oxide Per GDP','iso_code':'ISO Code'},
title="<b>Carbon(iv)oxide Emissions (Gigatonnes) for Different Countries in 2020</b>",
color_continuous_scale='reds')
fig.show()
fig = px.choropleth(world, color="co2",
locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.007,11000],
hover_data=["country", "co2", "co2_per_gdp"],width=1000,
labels={'country':'Country','year':'Year','co2':'Carbon(iv)Oxide in Gigatonnes',
'co2_per_gdp':'Carbon(iv)Oxide Per GDP','iso_code':'ISO Code'},
title="<b>Carbon(iv)oxide Emissions (Gigatonnes) for Different Countries in Different Years</b>",
animation_frame="year", color_continuous_scale='reds')
fig.show()
China, United States and India were the top 3 CO2 emitters in 2020. Island countries namely Tuvalu, Saint Helena and Niue are the lowest emitters
fig = px.choropleth(world_2020, color="co2_per_capita",
locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.020,37.1],
hover_data=["country", "co2_per_capita"],width=1000,
labels={'country':'Country','year':'Year','co2_per_capita':'Carbon(iv)Oxide Per Capita','iso_code':'ISO Code'},
title="<b>Carbon(iv)oxide(tonne) Per Capita Different Countries in 2020</b>",
color_continuous_scale='ylorrd')
fig.show()
Qatar, New Caledonia and Mongolia have the top 3 highest CO2 emissions per capita. Democratic Republic of Congo, Somalia and the Central African Republic have the lowest CO2 emissions per capita.
fig = px.choropleth(world_2020, color="cumulative_co2",
locations="iso_code",locationmode="ISO-3", scope="world",range_color=[0.260,417000],
hover_data=["country", "cumulative_co2"], width=1000,
labels={'country':'Country','year':'Year','cumulative_co2':'Cumulative Carbon(iv)Oxide (Gt)','iso_code':'ISO Code'},
title="<b>Cumulative Carbon(iv)oxide Emissions in Gigatonnes from 1750 to 2020 for Different Countries</b>",
color_continuous_scale='ylorrd')
fig.show()
The United States are the highest contributors of warming since 1750 followed by China and Russia.
#Select Data for OPEC Member-Countries Only
opec=world.query("(country=='Algeria'|country=='Angola'|country=='Congo'|country=='Equatorial Guinea'|country=='Gabon'|country=='Iran'|country=='Iraq'|country=='Kuwait'|country=='Libya'|country=='Nigeria'|country=='Saudi Arabia'|country=='United Arab Emirates'|country=='Venezuela') & (year==2015|year==2020)")
opecs=opec.copy()
opecs['hc_co2']=opecs.gas_co2+opecs.oil_co2
opecs=opecs[['year','country','hc_co2']]
#assign new columns for each year
opecs= pd.pivot_table(opecs, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecs
#find the change in co2
opecs['change in co2'] = opecs[2020] - opecs[2015]
#positive change=increase, negative change=decrease
bins = [opecs['change in co2'].min()-1, 0,opecs['change in co2'].max()+1]
labels = ['decrease', 'increase']
opecs['direction'] = pd.cut(opecs['change in co2'], bins=bins, labels=labels)
opecs['percent change']=(((opecs[2015]-opecs[2020])/opecs[2015])*100)
opecs
#plot the points
fig = px.scatter(opecs, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
height=1000,labels={'value':'Fossil Carbondioxide Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)
# iterate on each country
for i in opecs["country"]:
# filter by country
opec_country = opecs[opecs["country"] == i]
fig.add_shape(
type="line", opacity = 0.8,
layer="below",
# add connectors
y0=opec_country.country.values[0], x0=opec_country[2015].values[0],
y1=opec_country.country.values[0], x1=opec_country[2020].values[0],
line=dict(color="black",width=1)
)
fig.update_traces(marker=dict(size=10, opacity = 0.9))
fig.update_layout(width=970, height=1000,
xaxis=dict(showgrid=True),
yaxis=dict(showgrid=False),
title = "<b>Comparison of Fossil CO2 Emissions Generated by OPEC-Member Countries in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{y}</b>",
"Carbon(iv)oxide released from oil and gas : %{x}"]))
#render plot
fig.show()
Since COP 26, the oil and gas CO2 emissions of Algeria,Iran, Iraq and Nigeria have increased. With Iraq recording the highest increase. Angola, Congo, Equatorial Guinea, Gabon, Kuwait, Libya, Saudi Arabia, United Arab Emirates, Venezuela saw a reduction in oil and gas CO2 emissions. Venezuela recorded the highest decrease in oil and gas co2 emissions.
#Select Data for OPEC Member-Countries Only
opeccs=world.query("(country=='Algeria'|country=='Angola'|country=='Congo'|country=='Equatorial Guinea'|country=='Gabon'|country=='Iran'|country=='Iraq'|country=='Kuwait'|country=='Libya'|country=='Nigeria'|country=='Saudi Arabia'|country=='United Arab Emirates'|country=='Venezuela') & (year==2015|year==2020)")
opecss=opeccs.copy()
opecss['hc_co2']=opecss.gas_co2_per_capita+opecss.oil_co2_per_capita
opecss=opecss[['year','country','hc_co2']]
#assign new columns for each year
opecss= pd.pivot_table(opecss, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecss
#find the change in renewable electricity generation
opecss['change in co2 per capita'] = opecss[2020] - opecss[2015]
#positive change=increase, negative change=decrease
bins = [opecss['change in co2 per capita'].min()-1, 0,opecss['change in co2 per capita'].max()+1]
labels = ['decrease', 'increase']
opecss['direction'] = pd.cut(opecss['change in co2 per capita'], bins=bins, labels=labels)
opecss['percent change']=(((opecss[2015]-opecss[2020])/opecss[2015])*100)
opecss
#plot the points
fig = px.scatter(opecss, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
height=1000,labels={'value':'Fossil Carbondioxide per Capita Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)
# iterate on each country
for i in opecss["country"]:
# filter by country
opec_countryy = opecss[opecss["country"] == i]
fig.add_shape(
type="line", opacity = 0.8,
layer="below",
# add connectors
y0=opec_countryy.country.values[0], x0=opec_countryy[2015].values[0],
y1=opec_countryy.country.values[0], x1=opec_countryy[2020].values[0],
line=dict(color="black",width=1)
)
fig.update_traces(marker=dict(size=10, opacity = 0.9))
fig.update_layout(width=970, height=1000,
xaxis=dict(showgrid=True),
yaxis=dict(showgrid=False),
title = "<b>Comparison of OPEC-Member Countries Carbondioxide per Capita Emissions in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{y}</b>",
"Oil and Gas Carbon(iv)oxide per Capita: %{x}"]))
#render plot
fig.show()
Iran, Iraq and Nigeria all increased their per capita oil and gas emissions despite the Paris Agreement goals. Iraq had the highest increase fossil CO2 per capita emissions. Algeria, Angola, Congo, Equatorial Guinea, Gabon, Kuwait, Libya, Saudi Arabia, United Arab Emirates, Venezuela decreased their fossil per capita emissions. Venezuela also recorded the highest reduction in oil and gas per capita emissions.
# Select Data for OPEC Plus Member-Countries Only
opec_plus=world.query("(country=='Azerbaijan'|country=='Bahrain'|country=='Brunei'|country=='Kazakhstan'|country=='Malaysia'|country=='Mexico'|country=='Oman'|country=='Russia'|country=='Sudan'|country=='South Sudan') & (year==2015|year==2020)")
opecc_plus=opec_plus.copy()
opecc_plus.fillna(0, inplace=True)
opecc_plus['hc_co2']=opecc_plus.gas_co2+opecc_plus.oil_co2
opecc_plus=opecc_plus[['year','country','hc_co2']]
#assign new columns for each year
opecc_plus= pd.pivot_table(opecc_plus, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecc_plus
#find the change in co2
opecc_plus['change in co2'] = opecc_plus[2020] - opecc_plus[2015]
#positive change=increase, negative change=decrease
bins = [opecc_plus['change in co2'].min()-1, 0,opecc_plus['change in co2'].max()+1]
labels = ['decrease', 'increase']
opecc_plus['direction'] = pd.cut(opecc_plus['change in co2'], bins=bins, labels=labels)
opecc_plus['percent change']=(((opecc_plus[2015]-opecc_plus[2020])/opecc_plus[2015])*100)
opecc_plus['direction color'] = opecc_plus['direction'].replace('increase', '#f15656' ).replace('decrease', '#1a9d41')
opecc_plus
fig = go.Figure(go.Scatter(x = [0] * len(opecc_plus), y =opecc_plus[2015] , mode = 'lines+markers+text', showlegend = False, hovertext = opecc_plus['country'], name = 'Fossil CO2 Emissions in 2015',marker=dict(
color='#3970e7',
size=10)
))
fig.add_trace(go.Scatter( x = [1] * len(opecc_plus), y = opecc_plus[2020], mode = 'lines+markers+text', showlegend = False, hovertext = opecc_plus['country'], name = 'Fossil CO2 Emissions in 2020',marker=dict(
color='#3970e7',
size=10)
))
#add the connectors
for y0, y1, c in zip(opecc_plus[2015], opecc_plus[2020], opecc_plus['direction color']):
fig.add_shape(type='line', x0=0, x1=1, y0=y0, y1=y1, line=dict(
color=c))
#Add text on top of the connectors
fig.add_annotation(x=0, y=opecc_plus[2015].max()+50,
text="<b>Fossil CO2 Emissions in 2015</b>",
showarrow=False,
yshift=10, font = dict(color = 'black'))
fig.add_annotation(x=1, y=opecc_plus[2020].max()+50,
text="<b>Fossil CO2 Emissions in 2020</b>",
showarrow=False,
yshift=10, font = dict(color = 'black'))
#Add the names of the countrys
for i in range(len(opecc_plus)):
if i%2 == 1:
fig.add_annotation(x = 0-0.03, y = opecc_plus.iloc[i][2015], xanchor = 'right', text = opecc_plus.iloc[i]['country'], showarrow = False)
else:
fig.add_annotation(x = 1+0.03, y = opecc_plus.iloc[i][2020], xanchor = 'left', text = opecc_plus.iloc[i]['country'], showarrow = False)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{x}</b>",
"Fossil CO2 Emissions : %{y}"]))
#adjust the titles and axes
fig.update_layout(title = "<b>Comparison of Fossil CO2 Emissions by OPEC Plus-Member Countries in 2015 and 2020</b>",width=970, height=1000)
fig.update_xaxes(showticklabels = False)
fig.show()
Azerbaijan, Bahrain, Brunei and Kazakhstan all increased their oil and gas CO2 emissions compared to 2015 baseline. Brunei recorded the highest increase. Malaysia, Mexico, Oman, Russia and Sudan, South Sudan all recorded a reduction in oil and gas CO2 emissions. South Sudan recorded the highest reduction.
#Select Data for OPEC Member-Countries Only
opec_pluss=world.query("(country=='Azerbaijan'|country=='Bahrain'|country=='Brunei'|country=='Kazakhstan'|country=='Malaysia'|country=='Mexico'|country=='Oman'|country=='Russia'|country=='Sudan'|country=='South Sudan') & (year==2015|year==2020)")
opecc_pluss=opec_pluss.copy()
opecc_pluss.fillna(0, inplace=True)
opecc_pluss['hc_co2']=opecc_pluss.gas_co2_per_capita+opecc_pluss.oil_co2_per_capita
opecc_pluss=opecc_pluss[['year','country','hc_co2']]
#assign new columns for each year
opecc_pluss= pd.pivot_table(opecc_pluss, index = 'country', columns = 'year', values = 'hc_co2' ).reset_index()
opecc_pluss
#find the change in co2 per capita
opecc_pluss['change in co2 per capita'] = opecc_pluss[2020] - opecc_pluss[2015]
#positive change=increase, negative change=decrease
bins = [opecc_pluss['change in co2 per capita'].min()-1, 0,opecc_pluss['change in co2 per capita'].max()+1]
labels = ['decrease', 'increase']
opecc_pluss['direction'] = pd.cut(opecc_pluss['change in co2 per capita'], bins=bins, labels=labels)
opecc_pluss['percent change']=(((opecc_pluss[2015]-opecc_pluss[2020])/opecc_pluss[2015])*100)
opecc_pluss['direction color'] = opecc_pluss['direction'].replace('increase','#f15656').replace('decrease','#1a9d41')
opecc_pluss
fig = go.Figure(go.Scatter(x = [0] * len(opecc_pluss), y =opecc_pluss[2015] , mode = 'lines+markers+text', showlegend = False, hovertext = opecc_pluss['country'], name = 'Fossil CO2 per Capita Emissions in 2015',marker=dict(
color='#3970e7',
size=10)
))
fig.add_trace(go.Scatter( x = [1] * len(opecc_pluss), y = opecc_pluss[2020], mode = 'lines+markers+text', showlegend = False, hovertext = opecc_pluss['country'], name = 'Fossil CO2 per Capita Emissions in 2020',marker=dict(
color='#3970e7',
size=10)
))
#add the connectors
for y0, y1, c in zip(opecc_pluss[2015], opecc_pluss[2020], opecc_pluss['direction color']):
fig.add_shape(type='line', x0=0, x1=1, y0=y0, y1=y1, line=dict(
color=c))
#Add text on top of the connectors
fig.add_annotation(x=0, y=opecc_pluss[2015].max()+1,
text="<b>Fossil CO2 per Capita in 2015</b>",
showarrow=False,
yshift=10, font = dict(color = 'black'))
fig.add_annotation(x=1, y=opecc_pluss[2020].max()+1,
text="<b>Fossil CO2 per Capita in 2020</b>",
showarrow=False,
yshift=10, font = dict(color = 'black'))
#Add the names of the countrys
for i in range(len(opecc_pluss)):
if i%2 == 1:
fig.add_annotation(x = 0-0.03, y = opecc_pluss.iloc[i][2015], xanchor = 'right', text = opecc_pluss.iloc[i]['country'], showarrow = False)
else:
fig.add_annotation(x = 1+0.03, y = opecc_pluss.iloc[i][2020], xanchor = 'left', text = opecc_pluss.iloc[i]['country'], showarrow = False)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{x}</b>",
"Fossil CO2 per Capita Emisssions : %{y}"]))
#adjust the titles and axes
fig.update_layout(title = "<b>Comparison of Fossil CO2 per Capita Emissions of OPEC plus Member Countries in 2015 and 2020</b>",width=970, height=1000)
fig.update_xaxes(showticklabels = False)
fig.show()
Brunei was the only OPEC-Plus member to record an increase in oil and gas CO2 per capita emissions. Malaysia, Mexico, Oman, Russia and Sudan, South Sudan, Azerbaijan, Bahrain, and Kazakhstan all decreased their oil and gas CO2 per capita emissions. South Sudan also recorded the highest reduction here.
#Select Data for ZRF Endorsers Only
zrff=world.query("(country=='Angola'|country=='Azerbaijan'|country=='Bahrain'|country=='United countrys'|country=='Cameroon'|country=='Democratic Republic of Congo'|country=='Denmark'|country=='Ecuador'|country=='Egypt'|country=='France'|country=='Gabon'|country=='Germany'|country=='Indonesia'|country=='Iraq'|country=='Kazakhstan'|country=='Morocco'|country=='Mexico'|country=='Netherlands'|country=='New Zealand'|country=='Niger'|country=='Nigeria'|country=='Norway'|country=='Oman'|country=='Peru'|country=='Russia'|country=='Saudi Arabia'|country=='South Sudan'|country=='Turkmenistan'|country=='United Kingdom'|country=='Australia') & (year==2015|year==2020)")
zrf=zrff.copy()
zrf=zrf[['year','country','flaring_co2']]
#assign new columns for each year
zrf= pd.pivot_table(zrf, index = 'country', columns = 'year', values = 'flaring_co2' ).reset_index()
zrf
#find the change in flaring CO2
zrf['change in flaring co2'] = zrf[2020] - zrf[2015]
#positive change=increase, negative change=decrease
bins = [zrf['change in flaring co2'].min()-1, 0,zrf['change in flaring co2'].max()+1]
labels = ['decrease', 'increase']
zrf['direction'] = pd.cut(zrf['change in flaring co2'], bins=bins, labels=labels)
zrf['percent change']=(((zrf[2015]-zrf[2020])/zrf[2015])*100)
zrf
#plot the points
fig = px.scatter(zrf, x=[2015,2020], y="country", color_discrete_map= {'2020': 'red', '2015': 'green' },hover_name = 'country',width=1300,
height=1000,labels={'value':'Flaring CO2 Emissions in 2015 and 2020','country':'Country'})
fig.update(layout_showlegend=False)
# iterate on each country
for i in zrf["country"]:
# filter by country
zrf_country = zrf[zrf["country"] == i]
fig.add_shape(
type="line", opacity = 0.8,
layer="below",
# add connectors
y0=zrf_country.country.values[0], x0=zrf_country[2015].values[0],
y1=zrf_country.country.values[0], x1=zrf_country[2020].values[0],
line=dict(color="black",width=1)
)
fig.update_traces(marker=dict(size=10, opacity = 0.9))
fig.update_layout(width=970, height=1000,
xaxis=dict(showgrid=True),
yaxis=dict(showgrid=False),
title = "<b>Comparison of Flaring CO2 Emissions by World Bank Zero Routine Flaring Endorsers in 2015 and 2020</b>"
)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{y}</b>",
"Flaring Carbon(iv)oxide : %{x}"]))
#render plot
fig.show()
Australia, Iraq, Netherlands, Oman, Russia and Saudi Arabia all increased their flaring CO2 emissions compared to a 2015 baseline. Angola, Azerbaijan,Denmark, Ecuador, France, Gabon, Germany, Indonesia, Kazakhstan, New Zealand, Nigeria, Norway, Peru, United Kingdom all decreased their flaring-related CO2 emissions. There's missing flaring CO2 emissions data for other ZRF endorsers such as Bahrain, Cameroon, Democratic Republic of Congo, Egypt, Morocco, Niger, South Sudan, Turkmenistan and Mexico.
#Select Data for ZRF Endorsers Only
zrf2=world.query("(country=='Angola'|country=='Azerbaijan'|country=='Bahrain'|country=='United countrys'|country=='Cameroon'|country=='Democratic Republic of Congo'|country=='Denmark'|country=='Ecuador'|country=='Egypt'|country=='France'|country=='Gabon'|country=='Germany'|country=='Indonesia'|country=='Iraq'|country=='Kazakhstan'|country=='Morocco'|country=='Mexico'|country=='Netherlands'|country=='New Zealand'|country=='Niger'|country=='Nigeria'|country=='Norway'|country=='Oman'|country=='Peru'|country=='Russia'|country=='Saudi Arabia'|country=='South Sudan'|country=='Turkmenistan'|country=='United Kingdom'|country=='Australia') & (year==2015|year==2019)")
zrf2=zrf2[['year','country','methane']]
#assign new columns for each year
zrf2= pd.pivot_table(zrf2, index = 'country', columns = 'year', values = 'methane').reset_index()
zrf2
#find the change in methane emissions
zrf2['change in methane'] = zrf2[2019] - zrf2[2015]
#positive change=increase, negative change=decrease
bins = [zrf2['change in methane'].min()-1, 0,zrf2['change in methane'].max()+1]
labels = ['decrease', 'increase']
zrf2['direction'] = pd.cut(zrf2['change in methane'], bins=bins, labels=labels)
zrf2['percent change']=(((zrf2[2015]-zrf2[2019])/zrf2[2015])*100)
zrf2
#plot the points
fig = px.scatter(zrf2, x=[2015,2019], y="country", color_discrete_map= {'2019': 'red', '2015': 'green' },hover_name = 'country',width=1300,
height=1000,labels={'value':'Methane Emissions by ZRF Endorsers in 2015 and 2019','country':'Country'})
fig.update(layout_showlegend=False)
# iterate on each country
for i in zrf2["country"]:
# filter by country
zrf2_countryy = zrf2[zrf2["country"] == i]
fig.add_shape(
type="line", opacity = 0.8,
layer="below",
# add connectors
y0=zrf2_countryy.country.values[0], x0=zrf2_countryy[2015].values[0],
y1=zrf2_countryy.country.values[0], x1=zrf2_countryy[2019].values[0],
line=dict(color="black",width=1)
)
fig.update_traces(marker=dict(size=10, opacity = 0.9))
fig.update_layout(width=970, height=1000,
xaxis=dict(showgrid=True),
yaxis=dict(showgrid=False),
title = "<b>Comparison of Methane Emissions by World Bank Zero Routine Flaring Endorsers 2015 and 2019</b>"
)
#specify the hover template
fig.update_traces(
hovertemplate="<br>".join([
"<b>%{y}</b>",
"Methane Emissions : %{x}"]))
#render plot
fig.show()
2019 was used sinced 2020 methane data wasn't available.Australia, Azerbaijan, Bahrain, Cameroon, Democratic Republic of Congo, Ecuador, Egypt, Iraq, Kazakhstan, Mexico, Morocco, Niger, Nigeria, Oman, Peru, Russia, Saudi Arabia, Turkmenistan and the United Kingdom saw an increase in methane emissions compared to 2015 vthreshold. Angola, Denmark, France, Gabon, Germany, Indonesia, Netherlands, New Zealand, Norway, South Sudan all saw a decrease in methane emissions compared to a 2015 baseline.
world_cond=world[['population','gdp','co2','cumulative_co2','methane','nitrous_oxide','primary_energy_consumption','total_ghg']]
world_cond=world_cond.rename(columns={'population':'Population','gdp':'GDP','co2':'Carbon(iv)oxide','cumulative_co2':'Cumulative Carbon(iv)oxide','methane':'Methane','nitrous_oxide':'Nitrous Oxide','primary_energy_consumption':'Primary Energy Consumption','total_ghg':'Total Greenhouse Gas'})
fig=px.imshow(world_cond.corr(),text_auto=True, zmin=-1, zmax=1, origin=0,
title="<b>Relationship Between GHG Emissions and MacroEcomic Factors</b>")
fig.update_layout(width=1000,height=900)
fig.update_annotations(font_size=1000)
fig.show()
Overall, we see that GHG emissions are strongly correlated with macroeconomic factors such as GDP and population.
%%shell
jupyter nbconvert --to html Copy_of_Untitled16.ipynb